<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $this->display();
    }
    public function checkLogin(){
        $username = trim(I('post.admin_name'));
        $password =trim(I('post.password'));
        $result=M('admins')->where(array('admin_name'=>$username,'password'=>$password))->find();
        //var_dump($result);
        if(!$result)
            $this->error('密码输入错误');
        else
        {
            $this->success('登陆成功',U('Admin/User/userlist'));
           /* $url=U('Admin/User/userlist');
            header("Location: $url");*/
        }

    }
}